import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        component: resolve => require(['../views/Login'], resolve)
    },
    {
        path: '/Home',
        component: resolve => require(['../components/Home'], resolve),
        children: [
            {
                path: '/Info',
                component: resolve => require(['../views/InfoPage'], resolve)
            },
            {
                path: '/Consumer',  //用户管理
                component: resolve => require(['../views/ConsumerPage'], resolve)
            }, {
                path: '/Singer', //歌手管理
                component: resolve => require(['../views/SingerPage'], resolve)
            }, {
                path: '/SongList', //歌单管理
                component: resolve => require(['../views/SongListPage'], resolve)
            }, {
                path: '/Song',  //歌手的歌曲
                component: resolve => require(['../views/SongPage'], resolve)
            }
            , {
                path: '/ListSong', //歌单的歌曲
                component: resolve => require(['../views/ListSongPage'], resolve)
            }
        ]
    }

]

const router = new VueRouter({
    // mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
